package com.sq.controller;


import com.sq.pojo.Product;
import com.sq.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2020-06-02
 */
@Controller
@RequestMapping("/product")
public class ProductController {

	@Autowired
	ProductService productService;

	@PostMapping("/insert")
	public boolean insert(Product product) {
		return productService.insert(product);
	}

	@GetMapping("/getAll")
	public Product selectAll() {
		return productService.selectAll();
	}

	@PostMapping("/updateById")
	public Product update(Product product) {
		return productService.update(product);
	}

}

